﻿namespace Customer.Core.Data
{
    using Customer.Core.Configuration;
    using Customer.Core.Data.DBConfig;
    using Customer.Model.Model;
    using System.Data.Entity;
    public class CustomerEntities : DbContext
    {
        public CustomerEntities() : base(SystemConfiguration.ConnectionString) { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            Database.SetInitializer<CustomerEntities>(null);
            base.OnModelCreating(modelBuilder);
            modelBuilder.Configurations.Add(new CustomersConfiguration());
            modelBuilder.Configurations.Add(new CustomerRegionConfiguration());
            modelBuilder.Configurations.Add(new CustomerRelationConfiguration());
            modelBuilder.Configurations.Add(new CustomerContactConfiguration());
            modelBuilder.Configurations.Add(new ProductDepositConfiguration());
            modelBuilder.Configurations.Add(new ProductLoanConfiguration());
            modelBuilder.Configurations.Add(new BranchConfiguration());
            modelBuilder.Configurations.Add(new ProductCardConfiguration());
            modelBuilder.Configurations.Add(new ProductI2BConfiguration());
            modelBuilder.Configurations.Add(new ProductI2BDetailConfiguration());
            modelBuilder.Configurations.Add(new ProductPosConfiguration());
            modelBuilder.Configurations.Add(new BadBankConfiguration());
            modelBuilder.Configurations.Add(new LoanMatdtConfiguration());
            modelBuilder.Configurations.Add(new AlertCasaConfiguration());
            modelBuilder.Configurations.Add(new CustomerTop10Configuration());
            modelBuilder.Configurations.Add(new NewLendingConfiguration());
            modelBuilder.Configurations.Add(new AccountPlanningConfiguration());
            modelBuilder.Configurations.Add(new AccountPlanningFinanceConfiguration());
            modelBuilder.Configurations.Add(new AccountPlanningProductHoldingConfiguration());
            modelBuilder.Configurations.Add(new AccountPlanningFinanceResultConfiguration());
            modelBuilder.Configurations.Add(new AccountPlanningProductHoldingResultConfiguration());
            modelBuilder.Configurations.Add(new AccountPlanningHistoryConfiguration());
            modelBuilder.Configurations.Add(new TblAlertDepositMatdtConfiguration());
            modelBuilder.Configurations.Add(new ProductTradeConfiguration());
            modelBuilder.Configurations.Add(new ProductChuoiConfiguration());
            modelBuilder.Configurations.Add(new AlertLCConfiguration());
            modelBuilder.Configurations.Add(new AlertBLConfiguration());
            modelBuilder.Configurations.Add(new AlertLimitConfiguration());
            modelBuilder.Configurations.Add(new AlertInactiveConfiguration());
            modelBuilder.Configurations.Add(new CustomerFeedbackConfiguration());
            modelBuilder.Configurations.Add(new AlertBadbankTopdownConfiguration());
            modelBuilder.Configurations.Add(new CustomerPriorityConfiguration());
            modelBuilder.Configurations.Add(new CustomerFeedbackDetailConfiguration());
            modelBuilder.Configurations.Add(new AlertBadbankWatchlistConfiguration());
            modelBuilder.Configurations.Add(new AlertBadbankBottomupConfiguration());
            modelBuilder.Configurations.Add(new ProfitAbilityConfiguration());
            modelBuilder.Configurations.Add(new CustomerFinanceInfoConfiguration());
            modelBuilder.Configurations.Add(new CustomerLimitInfoConfiguration());
            modelBuilder.Configurations.Add(new CustomerLowValueConfiguration());
            modelBuilder.Configurations.Add(new AlertOverduConfiguration());
            modelBuilder.Configurations.Add(new AlertCardOverdueConfiguration());
            modelBuilder.Configurations.Add(new ProductCardRawDailyConfiguration());
            modelBuilder.Configurations.Add(new AlertGeneralConfiguration());
            modelBuilder.Configurations.Add(new CustomerNeedUpdateInfoConfiguration());
            modelBuilder.Configurations.Add(new CustomerNeedUpdateInfoRawConfiguration());
            modelBuilder.Configurations.Add(new CustomerInfoDescriptionConfiguration());
            modelBuilder.Configurations.Add(new FreedomCustomerConfiguration());
        }

        public DbSet<CustomerRegion> CustomerRegions { get; set; }
        public DbSet<Customers> Customers { get; set; }
        public DbSet<CustomerFeedback> CustomerFeedbacks { get; set; }
        public DbSet<CustomerFeedbackDetail> CustomerFeedbackDetails { get; set; }
        public DbSet<CustomerRelation> CustomerRelations { get; set; }
        public DbSet<CustomerContact> CustomerContacts { get; set; }
        public DbSet<CustomerPriority> CustomerPriorities { get; set; }
        public DbSet<ProductDeposit> ProductDeposits { get; set; }
        public DbSet<ProductLoan> ProductLoans { get; set; }
        public DbSet<ProductCard> ProductCards { get; set; }
        public DbSet<ProductCardRawDaily> ProductCardRaws { get; set; }
        public DbSet<ProductI2B> ProductI2Bs { get; set; }
        public DbSet<ProductI2BDetail> ProductI2BDetails { get; set; }
        public DbSet<ProductPos> ProductPoss { get; set; }
        public DbSet<ProductTrade> ProductTrades { get; set; }
        public DbSet<ProductChuoi> ProductChuois { get; set; }
        public DbSet<Branch> Branchs { get; set; }
        public DbSet<BadBank> BadBanks { get; set; }
        public DbSet<LoanMatdt> LoanMatdts { get; set; }
        public DbSet<AlertCasa> AlertCasas { get; set; }
        public DbSet<CustomerTop10> CustomerTop10s { get; set; }
        public DbSet<NewLending> NewLendings { get; set; }
        public DbSet<AccountPlanning> AccountPlannings { get; set; }
        public DbSet<AccountPlanningFinance> AccountPlanningFinances { get; set; }
        public DbSet<AccountPlanningProductHolding> AccountPlanningProductHoldings { get; set; }
        public DbSet<AccountPlanningFinanceResult> AccountPlanningFinanceResults { get; set; }
        public DbSet<AccountPlanningProductHoldingResult> AccountPlanningProductHoldingResults { get; set; }
        public DbSet<AccountPlanningHistory> AccountPlanningHistorys { get; set; }
        public DbSet<TblAlertDepositMatdt> TblAlertDepositMatdts { get; set; }
        public DbSet<AlertLC> AlertLCs { get; set; }
        public DbSet<AlertBL> AlertBLs { get; set; }
        public DbSet<AlertLimit> AlertLimits { get; set; }
        public DbSet<AlertInactive> AlertInactives { get; set; }
        public DbSet<AlertGeneral> AlertGenerals { get; set; }
        public DbSet<AlertBadbankTopdown> AlertBadBanks { get; set; }
        public DbSet<AlertOverdue> AlertOverdues { get; set; }
        public DbSet<AlertCardOverdue> AlertCardOverdues { get; set; }
        public DbSet<AlertBadbankWatchlist> AlertBadbankWatchlists { get; set; }
        public DbSet<AlertBadbankBottomup> AlertBadbankBottomups { get; set; }
        public DbSet<ProfitAbility> ToiAccumulateds { get; set; }
        public DbSet<CustomerFinanceInfo> CustomerFinanceInfos { get; set; }
        public DbSet<CustomerLimitInfo> CustomerLimitInfos { get; set; }
        public DbSet<CustomerLowValue> CustomerLowValues { get; set; }
        public DbSet<CustomerNeedUpdateInfo> CustomerNeedUpdateInfos { get; set; }
        public DbSet<CustomerNeedUpdateInfoRaw> CustomerNeedUpdateInfoRaws { get; set; }
        public DbSet<CustomerInfoDescription> CustomerInfoDescriptions { get; set; }
        public DbSet<CustomerFreedom> CustomerFreedoms { get; set; }
    }
}
